﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ETL.Business.Helpers;
using ETL.Common.Logging;
using ETL.Web.CustomCredential;
using WebMatrix.WebData;

namespace ETL.Web.Controllers
{
    public class CommonController : Controller
    {
        public void ClockOn(int category, string activity, string reason )
        {
            try
            {

                (new ClockOn()).Execute(category, activity, ETLCredential.UserId, ETLCredential.UserFullName, reason);
            }
            catch (Exception ex)
            {
                LogService.Service.Error(ex);
                throw ex;
            }
        }

        public void ClockOff()
        {
            try
            {
                (new ClockOff()).Execute(ETLCredential.UserId, ETLCredential.UserFullName);
            }
            catch (Exception ex)
            {
                LogService.Service.Error(ex);
                throw ex;
            }
        }
    }
}